package edu.nf.relaxenjoy.mapper;

import edu.nf.relaxenjoy.domain.entity.Follow;
import edu.nf.relaxenjoy.domain.vo.TrendVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zhu
 * @date 2024-12-19
 */
public interface FollowMapper {

    /**
     * 查询用户的所有关注
     * @param pageNum
     * @param pageSize
     * @param uid
     * @return
     */
    List<Follow> getPageByUid(@Param("pageNum") Long pageNum, @Param("pageSize") Long pageSize, Long uid);

    /**
     * 查找用户的所有粉丝
     * @param pageNum
     * @param pageSize
     * @param fid
     * @return
     */
    List<Follow> getPageByFid(@Param("pageNum") Long pageNum, @Param("pageSize") Long pageSize, Long fid);

    /**
     * 关注用户
     * @param follow
     */
    void insert(Follow follow);

    /**
     * 取消关注
     * @param uid
     * @param fid
     */
    void remove(Long uid, Long fid);

    List<TrendVo> getAllFollowTrends(@Param("pageNum") Long pageNum, @Param("pageSize") Long pageSize, String uid);
}
